package com.woniu.controller.homepage;

import com.woniu.service.homePage.ICommentService;
import com.woniu.util.ResData;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 凌雨
 * @data 2023/3/13 11:59
 */
@RestController
@RequestMapping("/app/comment")
public class CommentController {

    @Autowired
    private ICommentService commentService;

    /**
     * 查询所有的评论
     * @return
     */
    @RequestMapping("/queryComment")
    public ResData<?> queryComment(Integer goodsId){
        return commentService.queryComment(goodsId);
    }

    /**
     * 查询商品的评论数量
     * @param goodsId
     * @return
     */
    @RequestMapping("/queryCommentCount")
    public ResData<?> queryCommentCount(Integer goodsId){
        return commentService.queryCommentCount(goodsId);
    }

}
